#ifndef _TOOL_SETPARA_H_
#define _TOOL_SETPARA_H_

#ifdef __cplusplus
 extern "C" {
#endif

#include "includes.h"

#define USE_SPIFLASH
	 
#define U32_BUFSIZE 32 //32位发送数组中元素个数
#define W25Qxx_BUFSIZE 32*4
#define W25QxxAddress0 0
#define W25QxxAddress1 512

struct Parameter_User_Struct
{
	unsigned char Begin;//帧头
	//键鼠
	uint16_t SPEED1;//一档速度(0~660)
	uint16_t SPEED2;//二档速度(0~660)

	//遥控
	float DR_SPEED;//速度（越大越快）

	unsigned char End;//帧尾
};
union Parameter_User_Union
{
	struct Parameter_User_Struct data;
	u32 FlashData[U32_BUFSIZE];
	u8 W25QXXData[W25Qxx_BUFSIZE];
};


struct Parameter_Operater_Struct
{
	unsigned char Begin;//帧头

	unsigned char End;//帧尾
};

union Parameter_Operater_Union
{
	struct Parameter_Operater_Struct data;
	u32 FlashData[U32_BUFSIZE];
	u8 W25QXXData[W25Qxx_BUFSIZE];
};

void InitParameter_User(void);
void GetParameter_User(void);
void SetParameter_User(void);

void InitParameter_Operater(void);
void GetParameter_Operater(void);
void SetParameter_Operater(void);

void Tool_SetPara_Init(void);

u8 GetParaFlag(void);
void SetParaFlag(u8 _pFlag);
void SetPara_Operater(float mode);

#ifdef  _TOOL_SETPARA_GLOBALS
#define _TOOL_SETPARA_EXT     
#else   
#define _TOOL_SETPARA_EXT    extern  
#endif	

_TOOL_SETPARA_EXT union Parameter_Operater_Union Parameter_Operater;
_TOOL_SETPARA_EXT union Parameter_User_Union Parameter_User;
#ifdef __cplusplus
}
#endif

#endif

